package com.tanhua.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.manage.pojo.User;
import com.tanhua.manage.vo.UserActiveVo;
import com.tanhua.manage.vo.UserAnalysisVo;
import com.tanhua.manage.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


@Mapper
public interface UserMapper extends BaseMapper<User> {
    IPage<UserVo> queryByPage(Page<UserVo> userPage, @Param("id") String id, @Param("nickname")String nickname, @Param("city")String city);

    /**
     * 查询用户留存率
     * @param userPage
     * @param oddEven
     * @param sex
     * @param startDate
     * @param endDate
     * @return
     */
    IPage<UserActiveVo> queryUserActiveStateByDate(Page<UserActiveVo> userPage, @Param("oddEven") String oddEven, @Param("sex") String sex, @Param("startDate") String startDate, @Param("endDate") String endDate);


    /**
     * 用户每日登录注册活跃查询
     * @param userPage
     * @param oddEven
     * @param sex
     * @param startDate
     * @param endDate
     * @return
     */
    IPage<UserAnalysisVo> queryUserAnalysisByDate(Page<UserActiveVo> userPage, @Param("oddEven") String oddEven, @Param("sex") String sex, @Param("startDate") String startDate, @Param("endDate") String endDate);
}
